package jsyf.oa.dao.pm;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jsyf.oa.entity.pm.ProjectPlanEntity;
import jsyf.oa.entity.pm.ProjectTrackEntity;
import jsyf.oa.idao.BaseDao;
import jsyf.oa.ientity.IBaseEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: wangmin
 * @date: 2018/10/15 10:57
 */
@Repository
public class ProjectTrackDao extends BaseDao {
    @Override
    public IBaseEntity convertJson2Entity(JSONObject json) {
        return JSON.toJavaObject(json, ProjectTrackEntity.class);
    }


    public List<JSONObject> getTrackList(String projectId) {
        StringBuilder sbSql = new StringBuilder();
        sbSql.append("SELECT * FROM T_PM_TRACK ");
        sbSql.append("WHERE PROJECT_ID='" + projectId + "' ORDER BY CREATE_TIME DESC");
        return queryForJsonList(sbSql.toString());
    }
}
